<?php
if (!$con = mysql_connect('localhost', 'root', 'rootpass')) {
    echo 'Could not connect to mysql';
    exit;
}
if (!mysql_select_db('honeyviz', $con)) {
    echo 'Could not select database';
    exit;
}
$query =        "SELECT *
		FROM category
		ORDER BY parent_id, event_name;";
$result = mysql_query($query);
echo "<?xml version = '1.0' ?><data>";
while ($row = mysql_fetch_assoc($result)) {
        echo "<item>";
        echo "<id>" . $row['category_id'] . "</id>";
        echo "<parent>" . $row['parent_id'] . "</parent>";
        echo "<name>" . $row['event_name'] . "</name>";
        echo "</item>";
}
echo "</data>";
mysql_close($con);
?>

